<extend name="Public/base" />
<block name="body">
    <div class="main-title location">
        <h2><i>当前位置：</i>
        <gt name="_GET.pid" value="1">
        <a href="{:U('index?pid='.$current_parent['pid'])}" class="nav_a">返回上级</a>
        <else />分类列表</gt>
        <gt name="_GET.pid" value="1"><a href="javascript:;" class="nav_a">{$current_parent.title}</a></gt>
        <a href="{:U('add',array('pid'=>I('pid',0)))}">新增</a>
        </h2>
    </div>

    <form action="{:U('')}" method="post" class="form-inline">
        <label for="">中文名：</label>
        <input type="text" name="title" class="text-s" value="{:I('title')}">
        <select name="pid">
            <option value="0">请选择</option>
            <volist name="nav_tree" id="cate">
                <option value="{$cate.id}"<eq name="_GET.pid" value="$cate.id"> selected</eq>>{$cate.title_show}</option>
            </volist>
        </select>
        <button type="submit">搜索</button>
        <button class="pull-right" id="sortButton" data-operate="__URL__/sort/value/Cate-">排序</button>
    </form>
    <div class="typecho-table-wrap">
        <form action="{:U('delete')}" method="post" id="del_form">
            <table id="del_table" class="table table-hover">
                <thead>
                <tr>
                    <th><input type="checkbox" name="checkAll"></th>
                    <th>操作</th>
                    <th>名称</th>
                    <th>上级分类</th>
                    <th>排序</th>
                </tr>
                </thead>
                <tbody>
                <volist name="list" id="vo">
                <tr>
                    <td><input type="checkbox" name="id[]" value="{$vo.id}" class="ids"></td>
                    <td>
                        <a href="{:U('edit',array('id'=>$vo['id']))}">编辑</a>
                        <a href="{:U('index',array('pid'=>$vo['id']))}">进入</a>
                    </td>
                    <td>
                        <a href="javascript:;" class="editable" data-name="title" data-type="text" data-pk="{$vo.id}" data-url="{:U('ajaxUpdate')}">{$vo.title}</a>
                    </td>
                    <td>
                        <a href="javascript:;" class="editable group" data-name="pid" data-type="select" data-pk="{$vo.id}" data-source="{:U('editbleGetNav')}" sourceError="获取上级章节失败" data-url="{:U('ajaxUpdate')}" data-value="{$vo.pid}">{$vo.p_title|default=''}</a>
                    </td>
                    <td>
                        <a href="javascript:;" class="editable" data-name="sort" data-type="text" data-pk="{$vo.id}" data-url="{:U('ajaxUpdate')}">{$vo.sort}</a>
                    </td>
                </tr>
                </volist>
                </tbody>
            </table>
        </form>
    </div>
   <div class="pagination pagination-right">
        <button class="pull-left" id="batch_del">删除</button>
    </div>
</block>
